home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14514 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: dispatch.news.demon.net!demon!pcf.spectratek.co.uk
  2. From: Dean Darlison <dean_darlison@spectratek.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: function extruder ?
  5. Date: Mon, 15 Apr 1996 14:56:56 -0700
  6. Organization: Spectra-Tek UK Ltd
  7. Message-ID: <3172C628.70A2@spectratek.co.uk>
  8. References: <4ktir6$85n@cf01>
  9. NNTP-Posting-Host: pcf.spectratek.co.uk
  10. X-NNTP-Posting-Host: pcf.spectratek.co.uk
  11. X-Mailer: Mozilla 2.0 (Win16; I)
  12. MIME-Version: 1.0
  13. Content-Type: text/plain; charset=us-ascii
  14. Content-Transfer-Encoding: 7bit
  15.  
  16. Charles VIDAL wrote:
  17. > Does anyone knows about made a programe who extrude C function.
  18. > I have a source ( a C text file ) , and I want extrude only
  19. > a function in this file . Does a program make it or Howcan I do it??
  20. > thank's
  21. > reply by mail at vidalc@univ-mlv.fr
  22. > charles /  \
  23. > vidal  / ..|\
  24. >       (_\  |_)vidalc@univ-mlv.fr
  25. >       /  \@'
  26. >      /     \  http://fillmore.univ-mlv.fr/~vidalc
  27. >  _  /  `   |
  28. > \\/  \  | _\
  29. >  \   /_ || \\
  30. >   \____)|_) \_)
  31.  
  32. Assuming you're on Unix or have access to 'csplit' try variations on the 
  33. following:
  34.  
  35. csplit -sk sourcefile.c '%function_name%' '%^}%+1'
  36.  
  37. explanation:
  38.     sourcefile.c is your original C text file
  39.     '%function_name%' is a regexp defining the first location in the
  40.                       file to begin splitting from.
  41.     '&^}' is a regexp defining each split point. E.g. the last } of a
  42.                       function is found in the first column.
  43.  
  44. Play with the regexps and examine the output in xx?? files. The command
  45. will not alter sourcefile.c
  46.  
  47. After running this, your function should be found in xx00.
  48.  
  49. Cheers,
  50.    Dean.
  51. -- 
  52. Dean.A.Darlison        
  53. Spectra-Tek UK Ltd
  54. email:    dean_darlison@spectratek.co.uk
  55. Tel:    01653-695551
  56.